// 职责：负责执行各种各样的sql语句，不负责执行逻辑
const mysql = require('mysql');
function execSql(sql, callbackFn) {
    let conn = mysql.createConnection({
        host: '127.0.0.1',
        port: 3306,
        user: 'root',
        password: '123456',
        database: 'herodb'
    });

    conn.connect();

    conn.query(sql, callbackFn);

    conn.end();
};

// 导出的本质上是一个：execSql(sql, callbackFn)
module.exports = execSql;